test(storage): increase code coverage #650
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple changes to improve code functionality, enhance test coverage, and update dependencies. The most important changes include enabling code coverage in the Xcode scheme, adding new helper methods and extensions, updating the
StorageFileApiclass, and adding new test cases.Enhancements to Code Functionality:
.swiftpm/xcode/xcshareddata/xcschemes/Storage.xcscheme: Enabled code coverage and addedStorageTestsas a testable reference. [1] [2]Sources/Helpers/Codable.swift: Added a newJSONDecoderextension with a default decoder for Supabase.Sources/Helpers/HTTP/HTTPFields.swift: Added a newappendOrUpdatemethod toHTTPFieldsfor updating header values. [1] [2]Updates to
StorageFileApiClass:Sources/Storage/StorageFileApi.swift: Updated theStorageFileApiclass to useJSONEncoder.unconfiguredEncoderand modified themakeSignedURLmethod to handleStringinstead ofURL. [1] [2] [3] [4] [5] [6] [7] [8]Test Coverage Enhancements:
Tests/StorageTests/BucketOptionsTests.swift: Added new test cases forBucketOptionsto verify default and custom initialization.Tests/StorageTests/FileOptionsTests.swift: Added new test cases forFileOptionsto verify default and custom initialization.Tests/StorageTests/MultipartFormDataTests.swift: Added new test cases forMultipartFormDatato test boundary generation, data appending, and content headers.Dependency Updates:
Package.swift: AddedMockerandTestHelpersdependencies and included a new resource directoryFixtures.Deprecated Code Updates:
Sources/Storage/Codable.swift: MarkeddefaultStorageEncoderanddefaultStorageDecoderas deprecated.Sources/Storage/Deprecated.swift: Updated deprecation messages for initializers and deprecated structs. [1] [2] [3]